/* 显示类型：我要确定的容器(变量、形参)类型 */

// 给person、date添加了 类型注解
function greet(person: string, date: Date) {
  console.log(`Hello ${person}, today is ${date.toDateString()}!`);
}

greet("Maddison", Date());
// Error:Argument of type 'string' is not assignable to parameter of type 'Date'.

greet("Maddison", new Date());

// 类型注解并不总是需要些，TS可以自动推断
let msg = "hello there!";
// let msg: string